import { srcToType, blobToWebP, arrayBufferToWebP,downImg } from '../utils/webpconverter.js';

const toWebp = async (url) => {
	let webp = await srcToType(url,'image/webp',{});
	console.log(webp,'kjjj',webp.size/1024,webp.type)
	
	let src = URL.createObjectURL(webp);
	let img = new Image();
	img.src = src;
	document.getElementById('app').appendChild(img);
}

let btn = document.querySelector('button');
btn.addEventListener('click',() => {
	downImg("./img/download.webp");
})
	
toWebp("./img/download.webp");